package exemplos.layouts.hboxvbox;

import javafx.application.Application;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.stage.Stage;
import javafx.scene.control.Label;
import javafx.scene.control.TextField;
import javafx.scene.layout.HBox;
import javafx.scene.layout.VBox;


public class HBoxVBoxSample extends Application {

	final int TAM = 15;
    public void start(Stage primaryStage) throws Exception {
        Group root = new Group();
        primaryStage.setResizable(false);
        primaryStage.setScene(new Scene(root, 215, 420));
        TextField tfs[] = new TextField[TAM];
        Label lbls[] = new Label[TAM];
        HBox hboxLinhas[] = new HBox[TAM];
 
        for(int i = 0; i < TAM; i++) {
        	lbls[i] = new Label("Nome "+(i+1)+ " : ");
        	tfs[i] = new TextField();
        	hboxLinhas[i] = new HBox(5);
        	hboxLinhas[i].getChildren().addAll(lbls[i], tfs[i]);
            
        }
        VBox vboxColuna = new VBox(5);
        vboxColuna.getChildren().addAll(hboxLinhas);
        
        vboxColuna.setTranslateX(10);
        vboxColuna.setTranslateY(10);
        
        root.getChildren().add(vboxColuna);
        primaryStage.show();
    }
    public static void main(String[] args) { launch(args); }
}
